package com.qf.springbootdemo03.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * @author q
 * @version V1.0
 * @date 2021/11/25
 **/
@Configuration
public class PasswordEncoderConfig {

    /**
     * 加密策略
     *  BCryptPasswordEncoder ： 加密相同得密码，每次得到的结果不一样
     * @return
     */
    @Bean
    public PasswordEncoder passwordEncoder(){
        return new BCryptPasswordEncoder();
    }

}
